package com;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

import java.io.IOException;

@SpringBootApplication
@ServletComponentScan(value = "com.ServletContextListener")
@MapperScan(basePackages = {"com.dao"})
public class dianyingdingpiaoApplication extends SpringBootServletInitializer implements CommandLineRunner {

	public static void main(String[] args) {
		SpringApplication.run(dianyingdingpiaoApplication.class, args);
	}


	@Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) {
        return applicationBuilder.sources(dianyingdingpiaoApplication.class);
    }

	@Override
	public void run(String... args) throws Exception {

		String frontUrl = "http://localhost:8080/dianyingdingpiao/front/index.html";
		try {
			Runtime.getRuntime().exec(
					"cmd   /c   start  "+frontUrl);
		} catch (IOException e) {

			e.printStackTrace();
		}


	}
}
